﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="review.aspx.cs" Inherits="orgman_methods_modi" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>编辑</title>
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            text-align: center;
            font-size: medium;
        }
    </style>
    </head>
<body>   
    <form id="form1" runat="server">
    <div>
        <div id="content" style="text-align:center">
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:appConnectionString %>" 
                DeleteCommand="DELETE FROM [method] WHERE [methodid] = @methodid" 
                InsertCommand="INSERT INTO [method] ([methodname], [creator], [createdtime], [description], [organizationid]) VALUES (@methodname, @creator, @createdtime, @description, @organizationid)" 
                SelectCommand="SELECT methodid, methodname, creator, createdtime, description, available, organizationid FROM method WHERE (organizationid = @organizationid) ORDER BY methodid DESC" 
                
                UpdateCommand="UPDATE [method] SET [methodname] = @methodname, [description] = @description WHERE [methodid] = @methodid">
                <SelectParameters>
                    <asp:SessionParameter Name="organizationid" SessionField="organizationid" />
                </SelectParameters>
                <DeleteParameters>
                    <asp:Parameter Name="methodid" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="methodname" Type="String" />
                    <asp:Parameter Name="description" Type="String" />
                    <asp:Parameter Name="methodid" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="methodname" Type="String" />
                    <asp:Parameter Name="creator" Type="String" />
                    <asp:Parameter Name="createdtime" Type="DateTime" />
                    <asp:Parameter Name="description" Type="String" />
                    <asp:Parameter Name="organizationid" Type="Int32" />
                </InsertParameters>
            </asp:SqlDataSource>
            <div class="style1">
                现有评估方法概况：</div>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                DataKeyNames="methodid" DataSourceID="SqlDataSource1" 
                Width="700px" BorderStyle="Double" PageSize="5" AllowPaging="True" 
                BorderWidth="3px" CssClass="dataTable">
                <Columns>
                    <asp:BoundField DataField="methodname" HeaderText="方法名称" 
                        SortExpression="methodname" ItemStyle-Width="100px" >
<ItemStyle Width="120px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="creator" HeaderText="创建者" 
                        SortExpression="creator" ReadOnly="True" ItemStyle-Width="70px" >
<ItemStyle Width="80px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="createdtime" HeaderText="创建时间" 
                        SortExpression="createdtime" ReadOnly="True" ItemStyle-Width="120px" >
<ItemStyle Width="150px"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="description" HeaderText="描述" 
                        SortExpression="description" />
                    <asp:CommandField ShowSelectButton="True" SelectImageUrl="~/images/detail.gif" 
                        SelectText="点击查看">
                        <ItemStyle HorizontalAlign="Right" Width="80px" />
                    </asp:CommandField>
                </Columns>
                <EmptyDataTemplate>
                    您当前没有评估方法可以预览的。
                </EmptyDataTemplate>
            </asp:GridView>
            
            <br />
            <hr style="color: #3399FF" />
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                ConnectionString="<%$ ConnectionStrings:appConnectionString %>" 
                DeleteCommand="DELETE FROM [level] WHERE [levelid] = @levelid" 
                InsertCommand="INSERT INTO level(levelname, judgement, methodid, levelvalue) VALUES (@levelname, @judgement, @methodid, @levelvalue)" 
                SelectCommand="SELECT * FROM [level] WHERE ([methodid] = @methodid)" 
                
                UpdateCommand="UPDATE level SET levelname = @levelname, judgement = @judgement, levelvalue = @levelvalue WHERE (levelid = @levelid)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="GridView1" Name="methodid" 
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
                <DeleteParameters>
                    <asp:Parameter Name="levelid" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="levelname" Type="String" />
                    <asp:Parameter Name="judgement" Type="String" />
                    <asp:Parameter Name="levelvalue" Type="Single" />
                    <asp:Parameter Name="levelid" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="levelname" Type="String" />
                    <asp:Parameter Name="judgement" Type="String" />
                    <asp:Parameter Name="methodid" Type="Int32" />
                    <asp:Parameter Name="levelvalue" Type="Single" />
                </InsertParameters>
            </asp:SqlDataSource>
            <div style="text-align: left">现有的等级尺度：</div><asp:ListView ID="ListView1" runat="server" DataKeyNames="levelid" 
                DataSourceID="SqlDataSource2">
                <AlternatingItemTemplate>
                    <tr style=" width:700px;  border-width:3px; border-style:Double" class="dataTable">
                        <td>
                           
                        </td>
                        <td>
                            <asp:Label ID="levelidLabel" runat="server" Text='<%# Eval("levelid") %>' Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="levelnameLabel" runat="server" Text='<%# Eval("levelname") %>' />
                        </td>
                        <td>
                            <asp:Label ID="judgementLabel" runat="server" Text='<%# Eval("judgement") %>' />
                        </td>
                        <td>
                            <asp:Label ID="methodidLabel" runat="server" Text='<%# Eval("methodid") %>' Visible="false" />
                        </td>
                        <td>
                            <asp:Label ID="levelvalueLabel" runat="server" Text='<%# Eval("levelvalue") %>' />
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <LayoutTemplate>
                    <table runat="server" style=" width:700px;" class="dataTable">
                        <tr runat="server">
                            <td runat="server">
                                <table ID="itemPlaceholderContainer" runat="server" border="0" 
                                    style=" width:100%;">
                                    <tr runat="server" style=" color:White; background-color:#5d7b9d">
                                        <th runat="server">
                                        </th>
                                        <th runat="server">
                                            </th>
                                        <th runat="server">
                                            等级名称</th>
                                        <th runat="server">
                                            对应的评语</th>
                                        <th runat="server">
                                            </th>
                                        <th id="Th1" runat="server">
                                            分值</th>
                                    </tr>
                                    <tr ID="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr runat="server">
                            <td runat="server" 
                                style="">
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <InsertItemTemplate>
                    <tr style="">
                        <td>
                            
                        </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            <asp:TextBox ID="levelnameTextBox" runat="server" 
                                Text='<%# Bind("levelname") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="judgementTextBox" runat="server" 
                                Text='<%# Bind("judgement") %>' />
                        </td>
                        <td>
                            
                        </td>
                        <td>
                            <asp:TextBox ID="levelvalueTextBox" runat="server" 
                                Text='<%# Bind("levelvalue") %>' />
                        </td>
                    </tr>
                </InsertItemTemplate>
                <SelectedItemTemplate>
                    <tr style="">
                        <td>
                           
                        </td>
                        <td>
                           
                        </td>
                        <td>
                            <asp:Label ID="levelnameLabel" runat="server" Text='<%# Eval("levelname") %>' />
                        </td>
                        <td>
                            <asp:Label ID="judgementLabel" runat="server" Text='<%# Eval("judgement") %>' />
                        </td>
                        <td>
                          
                        </td>
                        <td>
                            <asp:Label ID="levelvalueLabel" runat="server" Text='<%# Eval("levelvalue") %>' />
                        </td>
                    </tr>
                </SelectedItemTemplate>
                <EmptyDataTemplate>
                    <table runat="server" 
                        style="">
                        <tr>
                            <td>
                                <asp:Label ID="Label1" runat="server" Text="当前评估方法没有等级，请先添加。" ForeColor="Red"></asp:Label></td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <EditItemTemplate>
                    <tr style="">
                        <td>
                           
                        </td>
                        <td>
                              </td>
                        <td>
                            <asp:TextBox ID="levelnameTextBox" runat="server" 
                                Text='<%# Bind("levelname") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="judgementTextBox" runat="server" 
                                Text='<%# Bind("judgement") %>' />
                        </td>
                        <td>
                         
                        </td>
                        <td>
                            
                            <asp:TextBox ID="levelTextBox" runat="server" 
                                Text='<%# Bind("levelvalue") %>' />
                        </td>
                    </tr>
                </EditItemTemplate>
                <ItemTemplate>
                    <tr style=" width:700px" class="dataTable">
                        <td>
                           
                        </td>
                        <td>
                             </td>
                        <td>
                            <asp:Label ID="levelnameLabel" runat="server" Text='<%# Eval("levelname") %>' />
                        </td>
                        <td>
                            <asp:Label ID="judgementLabel" runat="server" Text='<%# Eval("judgement") %>' />
                        </td>
                        <td>
                        </td>
                        <td>
                            <asp:Label ID="levelvalueLabel" runat="server" Text='<%# Eval("levelvalue") %>' />
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
            </div>
    </div>
    </form>
</body>
</html>
